/**
 * @description 获取客户
 * @param {*} args 参数
 * @returns array
 */
export function get(args) {
  return RSocket.rs({
    route: 'customers',
    args: { ...args },
  });
}

/**
 * @description 获取客户数量
 * @param {*} args 参数
 * @returns number
 */
export function count(args) {
  return RSocket.rr({
    route: 'customers.count',
    args: { ...args },
  });
}

/**
 * @description 删除客户
 * @param {*} id 客户id
 * @returns true
 */
export function deleteCustomer(id) {
  return RSocket.rr({
    route: `customers.${id}.delete`,
  });
}

/**
 * @description 修改客户
 * @param {*} data 客户数据
 * @returns true
 */
export function update(data) {
  return RSocket.rr({
    route: `customers.${data.username}.update`,
    data: { ...data },
  });
}

/**
 * @description 获取区域类型
 * @param {*} typeName 字典标识
 * @returns true
 */
export function getType(typeName) {
  return RSocket.rs({
    route: `dicts.${typeName}.items`,
  });
}

/**
 * @description 获取指定互联网用户
 * @param {*} typeName 字典标识
 * @returns true
 */
export function getCustomerUser(username) {
  return RSocket.rr({
    route: `inetusers.${username}`,
  });
}

/**
 * @description 获取巴士订单数量
 * @returns true
*/
// eslint-disable-next-line no-shadow
export function busOrderCount({ search }) {
  return RSocket.rr({
    route: 'busorders.count',
    args: { search },
  });
}

/**
 * @description 获取专线订单数量
 * @returns true
 */
// eslint-disable-next-line no-shadow
export function scOrderCount({ search }) {
  return RSocket.rr({
    route: 'scorders.count',
    args: { search },
  });
}

/**
 * @description 获取专线订单数量
 * @returns true
 */
// eslint-disable-next-line no-shadow
export function getCouponCount({ search }) {
  return RSocket.rr({
    route: 'biz.coupon.bags.count',
    args: { search },
  });
}

/**
 * @description 获取包车订单数量
 * @returns true
 */
// eslint-disable-next-line no-shadow
export function ccOrderCount({ search }) {
  return RSocket.rr({
    route: 'ccorders.count',
    args: { search },
  });
}

// eslint-disable-next-line no-shadow
export function getCoupons({ search }) {
  return RSocket.rs({
    route: 'biz.coupon.applies',
    args: { search, pg: { size: 999, page: 0, sort: ['crDate;desc'] } },
  });
}

// eslint-disable-next-line no-shadow
export function getActivities({ search }) {
  return RSocket.rs({
    route: 'biz.activities',
    args: { search, pg: { size: 999, page: 0, sort: ['crDate;desc'] } },
  });
}

/**
 * 获取接待打标列表
 * @param {*} param0
 * @returns
 */
export function getManagersInfo({ search, pg }) {
  return RSocket.rs({
    route: 'cbv.managers.reception.mark.info',
    args: {
      search,
      pg,
    },
  });
}

/**
 * 获取接待打标数量
 * @param {*} param0
 * @returns
 */
export function getManagersInfoCount({ search }) {
  return RSocket.rs({
    route: 'cbv.managers.reception.mark.info.count',
    args: {
      search,
    },
  });
}

